<!doctype html>
<html class="no-js">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>Companion</title>
<link href="../../../../images/logo-icon.svg" rel="icon" type="image/svg">    <script>var pathToRoot = "../../../../";</script>
    <script>document.documentElement.classList.replace("no-js","js");</script>
    <script>const storage = localStorage.getItem("dokka-dark-mode")
    if (storage == null) {
        const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
        if (osDarkSchemePreferred === true) {
            document.getElementsByTagName("html")[0].classList.add("theme-dark")
        }
    } else {
        const savedDarkMode = JSON.parse(storage)
        if(savedDarkMode === true) {
            document.getElementsByTagName("html")[0].classList.add("theme-dark")
        }
    }
    </script>
<script type="text/javascript" src="https://unpkg.com/kotlin-playground@1/dist/playground.min.js" async></script>
<script type="text/javascript" src="../../../../scripts/sourceset_dependencies.js" async></script>
<link href="../../../../styles/style.css" rel="Stylesheet">
<link href="../../../../styles/main.css" rel="Stylesheet">
<link href="../../../../styles/prism.css" rel="Stylesheet">
<link href="../../../../styles/logo-styles.css" rel="Stylesheet">
<link href="../../../../styles/font-jb-sans-auto.css" rel="Stylesheet">
<script type="text/javascript" src="../../../../scripts/clipboard.js" async></script>
<script type="text/javascript" src="../../../../scripts/navigation-loader.js" async></script>
<script type="text/javascript" src="../../../../scripts/platform-content-handler.js" async></script>
<script type="text/javascript" src="../../../../scripts/main.js" defer></script>
<script type="text/javascript" src="../../../../scripts/prism.js" async></script>
<script type="text/javascript" src="../../../../scripts/symbol-parameters-wrapper_deferred.js" defer></script></head>
<body>
    <div class="root">
<nav class="navigation" id="navigation-wrapper">
    <div class="navigation--inner">
        <div class="navigation-title">
            <button class="menu-toggle" id="menu-toggle" type="button">toggle menu</button>
            <div class="library-name">
<a class="library-name--link" href="../../../../index.html">
                            exposed
                    </a>            </div>
            <div class="library-version">0.57.0
            </div>
        </div>
        <div class="filter-section" id="filter-section">
                <button class="platform-tag platform-selector jvm-like" data-active="" data-filter=":exposed-core:dokkaHtmlPartial/main">jvm</button>
        </div>
    </div>
    <div class="navigation-controls">
        <button class="navigation-controls--btn navigation-controls--theme" id="theme-toggle-button" type="button">switch theme</button>
        <div class="navigation-controls--btn navigation-controls--search" id="searchBar" role="button">search in API</div>
    </div>
</nav>
        <div id="container">
            <div class="sidebar" id="leftColumn">
                <div class="sidebar--inner" id="sideMenu"></div>
            </div>
            <div id="main">
<div class="main-content" data-page-type="classlike" id="content" pageids="exposed-core::org.jetbrains.exposed.sql/Database.Companion///PointingToDeclaration//-1583301284">
  <div class="breadcrumbs"><a href="../../../index.html">exposed-core</a><span class="delimiter">/</span><a href="../../index.html">org.jetbrains.exposed.sql</a><span class="delimiter">/</span><a href="../index.html">Database</a><span class="delimiter">/</span><span class="current">Companion</span></div>
  <div class="cover ">
    <h1 class="cover"><span><span>Companion</span></span></h1>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":exposed-core:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">object </span><a href="index.html">Companion</a></div></div></div>
  </div>
  <div class="tabbedcontent">
    <div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION">Members</button></div>
    <div class="tabs-section-body">
      <div data-togglable="FUNCTION">
        <h2 class="">Functions</h2>
        <div class="table"><a data-name="113875410%2FFunctions%2F-1583301284" anchor-label="connect" id="113875410%2FFunctions%2F-1583301284" data-filterable-set=":exposed-core:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":exposed-core:dokkaHtmlPartial/main" data-filterable-set=":exposed-core:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="connect.html"><span><span>connect</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="113875410%2FFunctions%2F-1583301284"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":exposed-core:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="connect.html"><span class="token function">connect</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">getNewConnection<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html">Connection</a><span class="token punctuation">, </span></span><span class="parameter ">databaseConfig<span class="token operator">: </span><a href="../../-database-config/index.html">DatabaseConfig</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span></span><span class="parameter ">connectionAutoRegistration<span class="token operator">: </span><a href="../../-database-connection-auto-registration/index.html">DatabaseConnectionAutoRegistration</a><span class="token operator"> = </span>connectionInstanceImpl<span class="token punctuation">, </span></span><span class="parameter ">manager<span class="token operator">: </span><span class="token punctuation">(</span><a href="../index.html">Database</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="../../../org.jetbrains.exposed.sql.transactions/-transaction-manager/index.html">TransactionManager</a><span class="token operator"> = </span>{ ThreadLocalTransactionManager(it) }</span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="../index.html">Database</a></div><div class="symbol monospace"><span class="token keyword">fun </span><a href="connect.html"><span class="token function">connect</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">datasource<span class="token operator">: </span><a href="https://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html">DataSource</a><span class="token punctuation">, </span></span><span class="parameter ">setupConnection<span class="token operator">: </span><span class="token punctuation">(</span><a href="https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html">Connection</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator"> = </span>{}<span class="token punctuation">, </span></span><span class="parameter ">databaseConfig<span class="token operator">: </span><a href="../../-database-config/index.html">DatabaseConfig</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span></span><span class="parameter ">connectionAutoRegistration<span class="token operator">: </span><a href="../../-database-connection-auto-registration/index.html">DatabaseConnectionAutoRegistration</a><span class="token operator"> = </span>connectionInstanceImpl<span class="token punctuation">, </span></span><span class="parameter ">manager<span class="token operator">: </span><span class="token punctuation">(</span><a href="../index.html">Database</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="../../../org.jetbrains.exposed.sql.transactions/-transaction-manager/index.html">TransactionManager</a><span class="token operator"> = </span>{ ThreadLocalTransactionManager(it) }</span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="../index.html">Database</a></div><div class="symbol monospace"><span class="token keyword">fun </span><a href="connect.html"><span class="token function">connect</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">url<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">driver<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator"> = </span>getDriver(url)<span class="token punctuation">, </span></span><span class="parameter ">user<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator"> = </span><span class="token string">""</span><span class="token punctuation">, </span></span><span class="parameter ">password<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator"> = </span><span class="token string">""</span><span class="token punctuation">, </span></span><span class="parameter ">setupConnection<span class="token operator">: </span><span class="token punctuation">(</span><a href="https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html">Connection</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator"> = </span>{}<span class="token punctuation">, </span></span><span class="parameter ">databaseConfig<span class="token operator">: </span><a href="../../-database-config/index.html">DatabaseConfig</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span></span><span class="parameter ">connectionAutoRegistration<span class="token operator">: </span><a href="../../-database-connection-auto-registration/index.html">DatabaseConnectionAutoRegistration</a><span class="token operator"> = </span>connectionInstanceImpl<span class="token punctuation">, </span></span><span class="parameter ">manager<span class="token operator">: </span><span class="token punctuation">(</span><a href="../index.html">Database</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="../../../org.jetbrains.exposed.sql.transactions/-transaction-manager/index.html">TransactionManager</a><span class="token operator"> = </span>{ ThreadLocalTransactionManager(it) }</span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="../index.html">Database</a></div><div class="brief "><p class="paragraph">Creates a <a href="../index.html">Database</a> instance.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-1152560202%2FFunctions%2F-1583301284" anchor-label="connectPool" id="-1152560202%2FFunctions%2F-1583301284" data-filterable-set=":exposed-core:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":exposed-core:dokkaHtmlPartial/main" data-filterable-set=":exposed-core:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="connect-pool.html"><span>connect</span><wbr><span><span>Pool</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1152560202%2FFunctions%2F-1583301284"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":exposed-core:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="connect-pool.html"><span class="token function"><strike>connectPool</strike></span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">datasource<span class="token operator">: </span><a href="https://docs.oracle.com/javase/8/docs/api/javax/sql/ConnectionPoolDataSource.html">ConnectionPoolDataSource</a><span class="token punctuation">, </span></span><span class="parameter ">setupConnection<span class="token operator">: </span><span class="token punctuation">(</span><a href="https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html">Connection</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator"> = </span>{}<span class="token punctuation">, </span></span><span class="parameter ">databaseConfig<span class="token operator">: </span><a href="../../-database-config/index.html">DatabaseConfig</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span></span><span class="parameter ">connectionAutoRegistration<span class="token operator">: </span><a href="../../-database-connection-auto-registration/index.html">DatabaseConnectionAutoRegistration</a><span class="token operator"> = </span>connectionInstanceImpl<span class="token punctuation">, </span></span><span class="parameter ">manager<span class="token operator">: </span><span class="token punctuation">(</span><a href="../index.html">Database</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="../../../org.jetbrains.exposed.sql.transactions/-transaction-manager/index.html">TransactionManager</a><span class="token operator"> = </span>{ ThreadLocalTransactionManager(it) }</span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="../index.html">Database</a></div><div class="brief "><p class="paragraph">JDBC driver implementations of <code class="lang-kotlin">ConnectionPoolDataSource</code> are not actual connection pools, but rather a means of obtaining the physical connections to then be used in a connection pool. It is a known issue, with no plans to be fixed, that <code class="lang-kotlin">SQLiteConnectionPoolDataSource</code>, for example, creates a new connection each time instead of retrieving a pooled connection. Other implementations, like <code class="lang-kotlin">PGConnectionPoolDataSource</code>, suggest that a <code class="lang-kotlin">DataSource</code> or a dedicated third-party connection pool library should be used instead.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-759656340%2FFunctions%2F-1583301284" anchor-label="getDefaultIsolationLevel" id="-759656340%2FFunctions%2F-1583301284" data-filterable-set=":exposed-core:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":exposed-core:dokkaHtmlPartial/main" data-filterable-set=":exposed-core:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="get-default-isolation-level.html"><span>get</span><wbr><span>Default</span><wbr><span>Isolation</span><wbr><span><span>Level</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-759656340%2FFunctions%2F-1583301284"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":exposed-core:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="get-default-isolation-level.html"><span class="token function">getDefaultIsolationLevel</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">db<span class="token operator">: </span><a href="../index.html">Database</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></div><div class="brief "><p class="paragraph">Returns the stored default transaction isolation level for a specific database.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-845152185%2FFunctions%2F-1583301284" anchor-label="getDialectName" id="-845152185%2FFunctions%2F-1583301284" data-filterable-set=":exposed-core:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":exposed-core:dokkaHtmlPartial/main" data-filterable-set=":exposed-core:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="get-dialect-name.html"><span>get</span><wbr><span>Dialect</span><wbr><span><span>Name</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-845152185%2FFunctions%2F-1583301284"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":exposed-core:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="get-dialect-name.html"><span class="token function">getDialectName</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">url<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span></div><div class="brief "><p class="paragraph">Returns the database name used internally for the provided connection <a href="get-dialect-name.html">url</a>.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-1692133261%2FFunctions%2F-1583301284" anchor-label="registerDialect" id="-1692133261%2FFunctions%2F-1583301284" data-filterable-set=":exposed-core:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":exposed-core:dokkaHtmlPartial/main" data-filterable-set=":exposed-core:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="register-dialect.html"><span>register</span><wbr><span><span>Dialect</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1692133261%2FFunctions%2F-1583301284"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":exposed-core:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="register-dialect.html"><span class="token function">registerDialect</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">prefix<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">dialect<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="../../../org.jetbrains.exposed.sql.vendors/-database-dialect/index.html">DatabaseDialect</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Registers a new <a href="../../../org.jetbrains.exposed.sql.vendors/-database-dialect/index.html">DatabaseDialect</a> with the identifier <a href="register-dialect.html">prefix</a>.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="2069630204%2FFunctions%2F-1583301284" anchor-label="registerJdbcDriver" id="2069630204%2FFunctions%2F-1583301284" data-filterable-set=":exposed-core:dokkaHtmlPartial/main"></a>
          <div class="table-row" data-filterable-current=":exposed-core:dokkaHtmlPartial/main" data-filterable-set=":exposed-core:dokkaHtmlPartial/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="register-jdbc-driver.html"><span>register</span><wbr><span>Jdbc</span><wbr><span><span>Driver</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="2069630204%2FFunctions%2F-1583301284"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":exposed-core:dokkaHtmlPartial/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="register-jdbc-driver.html"><span class="token function">registerJdbcDriver</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">prefix<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">driverClassName<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">dialect<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Registers a new JDBC driver, using the specified <a href="register-jdbc-driver.html">driverClassName</a>, with the identifier <a href="register-jdbc-driver.html">prefix</a>.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
      <div class="footer">
        <span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2024 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span>
      </div>
            </div>
        </div>
    </div>
</body>
</html>

